/**
 * Zhz.net Inc.
 * Copyright (c) 2004-2010 All Rights Reserved.
 */
package com.zhz.lib.project.service.libnews;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.zhz.lib.project.ibatis.domain.libnews.Libnews;
import com.zhz.lib.project.vo.libnews.LibnewsVO;
import com.zhz.project.common.util.zhzutil.ZhzStringUtil;

/**
 *
 * @author liwei
 * @version $Id: LibnewsUtil.java, v 0.1 2010-12-5 下午04:42:12 liwei Exp $
 */
public class LibnewsUtil {

    public static List<LibnewsVO> ConvertTitle(List<Libnews> libnewsList, int MAX_LENGTH) {
        List<LibnewsVO> libnewsVOList = new ArrayList<LibnewsVO>();
        if (libnewsList != null && libnewsList.size() > 0)
            for (Libnews libnews : libnewsList) {
                LibnewsVO libnewsVO = new LibnewsVO();
                BeanUtils.copyProperties(libnews, libnewsVO);
                libnewsVO.setTitle(ZhzStringUtil.subStringWithDot(libnews.getTitle(), MAX_LENGTH));
                libnewsVOList.add(libnewsVO);
            }
        return libnewsVOList;

    }

}
